import { ref, onMounted } from 'vue'
import { getBanner } from '@/api/init.js'

// 二级分类轮播图
export function useBanner() {
  const bannerList = ref([])
  const getBannerList = async () => {
    const res = await getBanner(2)
    bannerList.value = res.result
  }

  onMounted(() => getBannerList())

  return { bannerList }
}
